<?php

namespace app\adminapi\export;

use Carbon\Carbon;
use app\services\distributor\DistributorApplicationService;

class DistributorAuditExport extends BaseExport
{
    protected $header = [
        '申请时间', '申请人昵称', '联系电话', '申请理由', '处理意见'
    ];

    public function createData(array $where)
    {
        $list = app()->make(DistributorApplicationService::class)->getAuditList($where)['list'];

        $data = [];

        foreach ($list as $item) {
            $data[] = [
                date('Y-m-d H:i:s',$item['add_time']),
                $item['nickname'],
                $item['contact_phone'],
                $item['application_reason'],
                $item['handling_comments']
            ];
        }
        return $data;
    }
}